<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head><!-- 备份驾驶员新增页面 -->
  <c:set var="ctx" value="${pageContext.request.contextPath }"></c:set>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		<title>华阳物流</title>
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/bootstrap.min.css"/>	
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/public.css"/>
		<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/resources/css/font-awesome.4.6.0.css"/>
		<link href="<%=request.getContextPath()%>/resources/css/foundation.min.css" rel="stylesheet" type="text/css">
		<link href="<%=request.getContextPath()%>/resources/css/foundation-datepicker.css" rel="stylesheet" type="text/css">
		
	</head>
	<body class="huayang">
		<header class="clearfix">
			<a class="navbar-brand pl-2 mr-0 d-inline logo1" href="#"><img src="<%=request.getContextPath()%>/resources/img/logo(1).png"></a>
			<a class="navbar-brand d-inline logo2" href="#"><img src="<%=request.getContextPath()%>/resources/img/logo.png"></a>
			<a class="navbar-brand d-inline logo3" href="#"><img src="<%=request.getContextPath()%>/resources/img/1.png"></a>
		</header>
		<div class="clearfix">
			
		</div>
        <nav class="navbar navbar-expand-lg navbar-light bg-light">
            <!--<a class="navbar-brand" href="#">Navbar</a>-->
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
              <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
           	
              <ul class="navbar-nav mr-auto">
              	<div class="container">       	
            	<div class="row clearfix">
              	<li class="nav-item active col-xs-6">
                  <a class="nav-link nav1" href="${ctx }/department/chengCity?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                <li class="nav-item active col-xs-6">
                  <a class="nav-link nav2" href="${ctx }/department/mianCity?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                 <li id="mz" class="nav-item active col-xs-6">
                  <a class="nav-link nav6" href="${ctx }/department/mzCity?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                <li class="nav-item active col-xs-6">
                  <a class="nav-link nav3" href="${ctx }/after/showAfter?pageNow=1&&deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
                <li class="nav-item active col-xs-6">
                 <a class="nav-link nav4" href="${ctx }/accountlist/selectAccountList?deptid=${deptid}&&rolename=${role.rolename}&deptname=&zhiling=&chexing=&xingming=&jiesuan=&jiashiyuanjs=&fatime1=&fatime2="><span></span></a>
                </li>
                <li class="nav-item active col-xs-6 current">
                  <a class="nav-link nav5" href="${ctx }/back/guanli?deptid=${deptid}&&rolename=${role.rolename}"><span></span></a>
                </li>
               </div>
              </div>
              </ul>
            <div class="clearfix"></div>
            <ul class="nav justify-content-center fixed-top align-middle clearfix ">
			  <li class="nav-item">
                <img class="user-img rounded-circle" src="<%=request.getContextPath()%>/resources/img/raw_1514434504.jpg"/>  
              </li>
              <li class="nav-item user-info">
                <span>${user.uname}</span>    
                <span>${role.rolename}</span> 
              </li>
              <li class="nav-item pwd-change">
                <a class="nav-link active align-text-bottom" href="${ctx }/tuser/pwdjsp?deptid=${deptid}">修改密码</a>                
              </li>
              <li class="nav-item exit"> 
              	<a href="${ctx }/back/userLoginOut" onclick="return confirm('您确定要退出系统吗？');" class="nav-link active"><span class="px-3">
					<img src="<%=request.getContextPath()%>/resources/img/exit.png"></span>退出</a>     
              </li>
            </ul>
          </div>       
        </nav>	
        <div class="container-fluid content">
        	<div class="row">
        		<div class="page_position d-none d-sm-block">
        			<!--位置-->
        			<!-- <div class="container-fluid pl-5">
        				<div class="row py-3">
        					<a href="#">绵阳</a>>><a href="#">新增驾驶员</a>
        				</div>
        			</div> -->
        		</div>
        			<div class="container-fluid pl-xl-5 pt-xl-5 p-0">
        				<div class="row pt-4 col-12 col-sm-12 col-lg-9 col-xl-10 p-0">
        				   <div class="container" id="contet-box">
        				   	<!--运单登记-->
        				   	<div class="row clearfix px-5">
		                    <div class="container_form ">
		                	
			                <form action="${ctx }/drivers/addDrivers"  method="post" id="fileupload" onsubmit="return drivertest()" enctype="multipart/form-data" role="form" class="col-center-block">
			                	<div class="col-lg-6 form-group input-group-three">
			                	<p class="text-left">新增驾驶员</p>
				                <div class="input-group">
								    <div class="input-group-addon">姓名：</div>
                                    <input type="text" name="dname" id="dname" class="form-control">
							    </div>
							    <div class="input-group">
								    <div class="input-group-addon">电话：</div>
                                    <input type="text" name="dphone" id="dphone" class="form-control">
							    </div>
				                <div class="input-group">
								    <div class="input-group-addon">意外保险时间：</div>
                                    <input type="text" name="daccident1" id="daccident" class="form-control timepick">
							    </div>
				                <div class="input-group">
								    <div class="input-group-addon">身份证号：</div>
                                    <input type="text" name="didentitycard" id="didentitycard" class="form-control">
							    </div>
				                <div class="input-group">
								    <div class="input-group-addon">身份证审核时间：</div>
                                    <input type="text" name="daudittime1" id="daudittime" class="form-control timepick">
							    </div>
				                <div class="input-group">
								    <div class="input-group-addon">登记证：</div>
                                    <input type="text" name="dcertificate" id="dcertificate" class="form-control">
							    </div>
				                <div class="input-group">
								    <div class="input-group-addon">登记证审核时间：</div>
                                    <input type="text" name="dauditdate1" id="dauditdate" class="form-control timepick">
							    </div>
				          
				                <div class="input-group">
								        <div class="input-group-addon">身份证：</div>
                                        <input type="file" name="files" id="img1" multiple="multiple"  accept="image/*" placeholder="身份证" >
							    </div>
							    <div class="input-group">
								        <div class="input-group-addon">登记证：</div>
                                        <input type="file" name="files" id="img2" multiple="multiple"   accept="image/*" placeholder="身份证" >
							    </div>
							    </div>
							    <div class="clearfix"></div>
				                <div class="form-group detail-button">
					                <div class="float-left">
						               <button type="submit" class="btn btn-default">提交</button>
						            </div>
                                    <div class="float-right">
                                       <button type="button" class="btn btn-default" onClick="history.back()">取消</button>
                                    </div>
				                </div>
				                
			                </form>
		                </div>          
		            </div>
        				   	<!--运单登记-->
        					</div>
        				</div>       				
        			</div>
        		</div>
        	</div> 
		<script src="<%=request.getContextPath()%>/resources/js/jquery.slim.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="<%=request.getContextPath()%>/resources/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
	<script type="text/javascript" src="<%=request.getContextPath()%>/resources/js/jquery.min.js"></script>
	<script src="<%=request.getContextPath()%>/resources/js/foundation-datepicker.js" type="text/javascript" charset="utf-8"></script>
        	<!--推送消息-->
        	
        		<jsp:include page="munetab.jsp" />
        	
	</body>
	<script type="text/javascript">
		$(function() {  
	        $("#dphone").change(function() {  
	            var dphone = $("#dphone").val();  
	            dphone = $.trim(dphone);  
	            if (!/^1[3|4|5|7|8|9][0-9]\d{4,8}$/.test(dphone)) {  
	                alert("您输入的手机号码不正确,请重新输入");  
	            }
	        }); 
	        $("#didentitycard").change(function() {  
	            var didentitycard = $("#didentitycard").val();  
	            didentitycard = $.trim(didentitycard);  
	            if (!/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$/.test(didentitycard)) {  
	                alert("您输入的身份证号码不正确,请重新输入");  
	            }
	        }); 
	    });  
	    
	    function drivertest(){
	    	var dname = document.getElementById("dname").value;
	    	var dphone = document.getElementById("dphone").value;
	    	var daccident = document.getElementById("daccident").value;
	    	var didentitycard = document.getElementById("didentitycard").value;
	    	var daudittime = document.getElementById("daudittime").value;
	    	var dcertificate = document.getElementById("dcertificate").value;
	    	var dauditdate = document.getElementById("dauditdate").value;
	    	var img1 = document.getElementById("img1").value;
	    	var img2 = document.getElementById("img2").value;
	    	
	    	if(dname==null||dname==""||dname==undefined){
				alert("请输入姓名");
				return false;
			}
			if(dphone==null||dphone==""||dphone==undefined){
				alert("请输入电话");
				return false;
			}
			if(daccident==null||daccident==""||daccident==undefined){
				alert("请选择意外保险时间");
				return false;
			}
			if(didentitycard==null||didentitycard==""||didentitycard==undefined){
				alert("请输入身份证号");
				return false;
			}
			if(daudittime==null||daudittime==""||daudittime==undefined){
				alert("请选择身份证审核时间");
				return false;
			}
			if(dcertificate==null||dcertificate==""||dcertificate==undefined){
				alert("请输入登记证");
				return false;
			}
			if(dauditdate==null||dauditdate==""||dauditdate==undefined){
				alert("请选择登记证审核时间");
				return false;
			}
			if(img1==null||img1==""||img1==undefined){
				alert("请上传身份证图片");
				return false;
			}
			if(img2==null||img2==""||img2==undefined){
				alert("请上传登记证图片");
				return false;
			}
			
			
	    
	    }
	    
	    $('.timepick').fdatepicker({
			format: 'yyyy-mm-dd hh',
			pickTime: 1,
		});
	</script>
	<script type="text/javascript">

		!function(){
		
			laydate.skin('dahong');//切换皮肤，请查看skins下面皮肤库
		
			laydate({elem: '#demo'});
			laydate({elem: '#demo1'});
			laydate({elem: '#demo2'});
			laydate({elem: '#demo3'});//绑定元素
			//绑定元素
		
		}();
		
		
		
		//日期范围限制
		
		var start = {
		
		    elem: '#start',
		
		    format: 'YYYY-MM-DD',
		
		    min: laydate.now(), //设定最小日期为当前日期
		
		    max: '2099-06-16', //最大日期
		
		    istime: true,
		
		    istoday: false,
		
		    choose: function(datas){
		
		         end.min = datas; //开始日选好后，重置结束日的最小日期
		
		         end.start = datas //将结束日的初始值设定为开始日
		
		    }
		
		};
		
		
		
		var end = {
		
		    elem: '#end',
		
		    format: 'YYYY-MM-DD',
		
		    min: laydate.now(),
		
		    max: '2099-06-16',
		
		    istime: true,
		
		    istoday: false,
		
		    choose: function(datas){
		
		        start.max = datas; //结束日选好后，充值开始日的最大日期
		
		    }
		
		};
		
		laydate(start);
		
		laydate(end);
		
		
	</script>
	<script type="text/javascript"> 
		   window.onload=function(){ 
				var action ='<%=request.getAttribute("result")%>';
				if(action.length!==4)
				{
						alert(action);
				}
			} 
		</script>
</html>
